-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a simpleimage
template for custom components
#7129
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/06c616103fcd6c36262b642b1b4940a95ffcad4b/gradio-4.16.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@06c616103fcd6c36262b642b1b4940a95ffcad4b#subdirectory=client/python" |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
elif component.template in gradio._simple_templates.__all__: # type: ignore | ||
module = "_simple_templates" | ||
else: | ||
def find_template_in_list(template, list_to_search): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was bothering me that the parameter to --template
was case sensitive. This change makes it case-insensitive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice PR @abidlabs - left some nits
Thanks @freddyaboulton and @pngwn. I've made the changes and I'll go ahead and merge this in. I'll bother you later if it doesn't work as a template |
Adds a
SimpleImage
template as I think many users may want to template off of theImage
component to get the upload/drag + preview behavior, but the regularImage
component has a lot of extra functionality that is not needed (e.g. sharing to HF, support for multiple sources, various PIL-related preprocessing, the .select() event)I built
SimpleImage
as a custom component myself so it works as a component, but I'm not sure if it can be used as a template or if I need to do something else besides place the files in the right place. Would appreciate any insights @freddyaboulton @pngwn